CreateStack
Description
call CreateStack interface to create resource stack.
Request Method
POST
Request Path
/apsara/route/ROS/CreateStack
Request Parameters Common Parameters
Name | Location | Type | Required | Sample value | Description |
---|---|---|---|---|---|
Parameters.N.ParameterKey | BODY | string | Yes | InstanceId | parameter name. If the name and value of the parameter are not specified, ROS will use the default value specified in the template. The maximum value of N is: 200. description Parameters as an optional parameter. if the Parameters needs to be specified, the Parameters. n. ParameterKey and Parameters. n. ParameterValue must be specified at the same time. |
Parameters.N.ParameterValue | BODY | string | Yes | i-xxxxxx | parameter value. The maximum value of N is: 200. description Parameters as an optional parameter. if the Parameters needs to be specified, the Parameters. n. ParameterKey and Parameters. n. ParameterValue must be specified at the same time. |
TemplateBody | BODY | string | No | { "ROSTemplateFormatVersion": "2015-09-01" } | the structure of the template body. The length is 1~524 and 288 bytes. If the length is large, it is recommended to pass the parameters in the request body through HTTP POST + Body Param to avoid request failure due to too long URL. description you must specify the parameter TemplateBody or TemplateURL, but not at the same time. |
StackPolicyBody | BODY | string | No | {"Statement": [{"Action": "Update:*", "Resource": "*", "Effect": "Allow", "Principal": "*"}]} | contains the structure of the resource stack policy body, with a length of 1~16,384 bytes. description you must specify StackPolicyBody or StackPolicyURL parameters, but not at the same time. |
NotificationURLs.N | BODY | repeatlist | No | http://my-site.com/ros-event | URL callback address for receiving stack events. Currently, only HTTP POST is supported. N maximum value: 5. maximum length of each URL: 1024 bytes. when the status of the resource stack changes, it will be notified. When the resource stack enables rollback, CREATE_FAILED (creation failure) and UPDATE_FAILED (update failure) are not notified, while CREATE_ROLLBACK (creation failure rollback) and ROLLBACK (update failure rollback) are notified. Description IN_PROGRESS status will not be notified. notifications will be made regardless of whether the Outputs is defined in the resource stack. An example of notification content is as follows: { "Outputs ": [ { "Description": "No description given ", "OutputKey": "InstanceId ", "OutputValue": "i-xxx" } ], "StackId": "80bd6b6c-e888-4573-ae3b-93d29113 ****", "StackName": "test-notification-url ", "Status": "CREATE_COMPLETE"} |
DeletionProtection | BODY | string | No | Enabled | whether to enable stack deletion protection. Value: Enabled: enable stack deletion protection. Disabled (default): turn off stack deletion protection. At this time, the resource stack can be released through the console or API(DeleteStack). description nested resource stack deletion protection is consistent with the root resource stack. |
StackPolicyURL | BODY | string | No | oss://ros-stack-policy/demo | the location of the file containing the resource stack policy. The URL must point to a policy located in a Web server (HTTP or HTTPS) or Aliyun OSS bucket (for example, oss:// ros/stack-policy/demo, oss:// ros/stack-policy/demo?RegionId = cn-hangzhou). The maximum length of the policy file is 16 and 384 bytes. If the OSS region is not specified, the default RegionId is the same as the interface parameter. description you must specify the parameter StackPolicyBody or StackPolicyURL, but not at the same time. The maximum length of the URL is 1350 bytes. |
version | BODY | string | No | 2016-01-01 | version of api |
TemplateURL | BODY | string | No | oss://ros-template/demo | the location of the file containing the template body. The URL must point to the template (1~524,288 bytes) located in the HTTP Web server (HTTP or HTTPS) or Aliyun OSS bucket. The URL of the OSS bucket is such as oss:// ros/template/demo or oss:// ros/template/demo?RegionId = cn-hangzhou. If the OSS region is not specified, the default RegionId is the same as the interface parameter. description you must specify TemplateBody or TemplateURL parameters, but not at the same time. |
RamRoleName | BODY | string | No | test-role | RAM role name. ROS will play this role to create a resource stack and use the role's credentials to make interface calls on behalf of the user. ROS always uses this role for operations that will take place on the resource stack. As long as the user has the right to operate on the resource stack, even if the user does not have the right to use the role, ROS will use this role to ensure that the role grants minimal permissions. If the user does not specify this value, ROS will use the role previously associated with the resource stack. If no role is available, ROS will use temporary credentials generated from your user credentials. the maximum length of the RAM role name is 64 characters. |
regionId | BODY | string | Yes | No sample value for this parameter. | region id |
RegionId | BODY | string | Yes | cn-hangzhou | the region ID to which the resource stack belongs. |
CreateOption | BODY | string | No | KeepStackOnCreationComplete | used to control the behavior of creating resource stacks, value: KeepStackOnCreationComplete (default): after the resource stack is successfully created, the resources in the resource stack and the resource stack are retained, occupying the limit of the number of resource stacks allowed by ROS. AbandonStackOnCreationComplete: delete the resource stack after the resource stack is successfully created, but retain all resources and do not occupy the limit of the number of resource stacks allowed by ROS. If the resource stack creation fails, the resource stack will be retained. |
ClientToken | BODY | string | No | 123e4567-e89b-12d3-a456-42665544**** | guarantees the idempotence of the request. This value is generated by the client and must be globally unique. is no more than 64 characters in length and can contain English letters, numbers, dashes (-) and underscores (_). |
StackName | BODY | string | Yes | MyStack | resource stack name. must be no more than 255 characters in length and must start with a number or an English letter, which can contain numbers, English letters, dashes (-), and underscores (_). |
DisableRollback | BODY | boolean | No | false | whether to disable the rollback policy when the resource stack creation fails. Value: true: disable rollback, that is, no rollback is performed when the resource stack creation fails. false (default): rollback is not disabled, that is, rollback is performed when the resource stack creation fails. |
TimeoutInMinutes | BODY | long | No | 10 | timeout for creating the resource stack. default value: 60. Unit: minutes. |
Return data
Name | Type | Sample value | Description |
---|---|---|---|
RequestID | string | 1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC | Request id |
Example
Successful Response example
{
"RequestID":"1E3D5A1E0-67CA-43DA-24BC-EAF2D5A1E4DC"
}
Failed Response example
{
"errorSample":
{
"resultCode":-1,
"resultMsg":"system error",
"result":null
}
}